<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>新增简历</title>
<script type="text/javascript" src="static/easyui/jquery.min.js"></script>
<script type="text/javascript" src="static/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="static/easyui/locale/easyui-lang-zh_CN.js"></script>
<link rel="stylesheet" href="static/easyui/themes/icon.css">
<link rel="stylesheet" href="static/easyui/themes/metro-red/easyui.css">
</head>
<body>
<style type="text/css">
.insertjl{
	width:1000px;
	height:500px;
	margin:20px auto;
}
.jianlione	{
	font-size:18px;
	color:#30B399;
	width:1000px;
	height:30px;
	text-align:center;
	margin:30px auto;
	line-height:30px;
	background-color:#F4F4F4;
}
#insertriw,#phone{
	margin-left:-12px;
}
.jianlitwo{
	width:900px;
	height:300px;
	margin:20px auto;
}
.jianlileft{
	width:400px;
	height:100px;
	float:left;
	margin-left:40px;
}
.jianlileft ul li{
	list-style: none;
	margin-top:30px;
}
.jianliright{
	width:400px;
	height:100px;
	float:right;
	margin-right:-30px;
}
.jianliright ul li{
	list-style: none;
	margin-top:30px;
}
.jlreturn{
	width:60px;
	height:25px;
	color:white;
	border:none;
	float:left;
	cursor:pointer;
}
.jlbeok{
	width:60px;
	height:25px;
	color:white;
	border:none;
	float:right;
	cursor:pointer;
}
.icon-interview-return{
	padding-left: 20px;
	background:url('static/easyui/themes/icons/fanhui.png') no-repeat 5% 50%;
	background-color:#EC971F;
}
.icon-interview-beok{
	padding-left: 20px;
	background:url('static/easyui/themes/icons/baocun.png') no-repeat 5% 50%;
	background-color:#13826B;
}
</style>
<script type="text/javascript">
$(function(){	
	
	//新增界面中确定按钮
	$("#jlqueding").click(function(){
		//新增姓名
		var riviewname = $("#riviewname").val();
		//新增面试官
		var staff_id = $("#staff_id").val();
		//新增面试方式
		var riviewway = $("#riviewway").val();
		//新增面试时间
		var riviewtime = $("#riviewtime").val();
		//新增性别
		var reasysex = $("#reasysex").val();
		//新增年龄
		var reasyage = $("#reasyage").val();
		//新增应聘职位
		var position_id = $("#position_id").val();
		//新增所属计划
		var rapplyid = $("#rapplyid").val();
		//新增手机号
		var reasyphone = $("#reasyphone").val();
		//新增邮箱
		var reasyemail = $("#reasyemail").val();
		
		if (riviewname==null || riviewname=="null" || riviewname=="") {
			alert("请输入姓名");
		}else if(staff_id==null || staff_id=="null" || staff_id==""){
			alert("请输入面试官");
		}else if(riviewway==null || riviewway=="null" || riviewway==""){
			alert("请输入面试方式");
		}else if(riviewtime==null || riviewtime=="null" || riviewtime==""){
			alert("请输入面试时间");
		}else if(reasysex==null || reasysex=="null" || reasysex==""){
			alert("请输入性别");
		}else if(reasyage==null || reasyage=="null" || reasyage==""){
			alert("请输入年龄");
		}else if(position_id==null || position_id=="null" || position_id==""){
			alert("请输入应聘职位");
		}else if(rapplyid==null || rapplyid=="null" || rapplyid==""){
			alert("请输入所属计划");
		}else if(reasyphone==null || reasyphone=="null" || reasyphone==""){
			alert("请输入手机号");
		}else if(reasyemail==null || reasyemail=="null" || reasyemail==""){
			alert("请输入邮箱");
		}else {
			$.ajax({
			url:"select-jianliinsert",
			type:"post",
			data:{
				"riviewname":riviewname,
				"staff_id":staff_id,
				"riviewway":riviewway,
				"riviewtime":riviewtime,
				"reasysex":reasysex,
				"reasyage":reasyage,
				"position_id":position_id,
				"rapplyid":rapplyid,
				"reasyphone":reasyphone,
				"reasyemail":reasyemail
			},
		})			
		//页面刷新
		$("#content-admin").panel('open').panel('refresh','recruitinterview');
		$("#insertjianli").window("close");	
		}
	})
	
	//点击返回按钮
	$("#jlfanhui").click(function(){
		add("recruitinterview");
	});
	//招聘职位
	$('#position_name').combogrid({
	        panelWidth:200,
	        url:'select_zhiweiKuang',
	        singleSelect:true,
	        idField:'position_name',
	        treeField:'position_name',
	        columns:[[
	        	{field:'sortable',title:'#',width:35,align:'center'},
	        	{field:'position_id',hidden:true},
	            {field:'position_name',title:'招聘职位',width:160,align:'center'}
	        ]],
        onClickRow:function(rowIndex, rowData){
    		$("#position_id").val(rowData['position_id']);
    		var id=rowData['position_id'];
    		//面试官
    		$('#staff_name').combogrid({
    	        panelWidth:200,
    	        url:'select-positions?id='+id,
    	        singleSelect:true,
    	        idField:'Staff_name',
    	        treeField:'Staff_name',
    	        columns:[[
    	        	{field:'sortable',title:'#',width:35,align:'center'},
    	        	{field:'Staff_id',hidden:true},
    	            {field:'Staff_name',title:'姓名',width:160,align:'center'}
    	        ]],
    	       
    	        onClickRow:function(rowIndex, rowData){
    	    		$("#staff_id").val(rowData['staff_id']);
    	    	}
    		});
    	}
});
	//招聘所属计划
	$('#rapplyname').combogrid({
	        panelWidth:200,
	        url:'select_apply',
	        singleSelect:true,
	        idField:'rapplyname',
	        treeField:'rapplyname',
	        columns:[[
	        	{field:'sortable',title:'#',width:35,align:'center'},
	        	{field:'rapplyid',hidden:true},
	            {field:'rapplyname',title:'招聘所属计划',width:160,align:'center'}
	        ]],
        onClickRow:function(rowIndex, rowData){
    		$("#rapplyid").val(rowData['rapplyid']);
    	}
});
});
</script>
<div class="insertjl">
	<div class="jianlione">新增面试人</div>
	<div class="jianlitwo">
   	<input type="hidden" id="staff_id">
   	<input type="hidden" id="rapplyid">
   	<input type="hidden" id="position_id">
		<div class="jianlileft">
			<ul>
				<li><span>姓名：</span><input id="riviewname" type="text" style="width:240px;"></li>	
				<li><span>性别：</span><input id="reasysex" type="text" style="width:240px;"></li>
				<li><span>年龄：</span><input id="reasyage" type="text" style="width:240px;"></li>		
				<li><span id="insertriw">面试官：<input id="staff_name" type="text" style="width:242px;"></span></li>
				<li><span id="phone">手机号：</span><input id="reasyphone" type="text" style="width:240px;"></li>	
			</ul>
		</div>
		<div class="jianliright">
			<ul>
				<li><span>应聘职位：</span><input id="position_name" type="text" style="width:240px;"></li>
				<li><span>电子邮箱：</span><input id="reasyemail" type="text" style="width:240px;"></li>
				<li><span>面试时间：</span><input id="riviewtime" class="easyui-datetimebox" type="text" data-options="required:true,showSeconds:false" style="color:#777777;width:242px;"></li>
				<li>
					<span>面试方式：</span>
					<select id="riviewway" style="width:240px;height:22px;">
						<option>--请选择--</option>
						<option>一对一</option>
						<option>一对多</option>
					</select>
				</li>
				<li><span>所属计划：</span><input  id="rapplyname" type="text" style="width:240px;"></li>	
			</ul>
		</div>
	</div>
	<div class="jianlibottom" style="width:200px;height:30px;margin:20px auto;">
		<button id="jlfanhui" class="jlreturn icon-interview-return">返回</button>
		<button id="jlqueding" class="jlbeok icon-interview-beok">保存</button>
	</div>
</div>
</body>
</html>